import request from '@/config/axios'

// 产品规格信息表 (Product Specifications Table) VO
export interface ProductSpecificationsVO {
  id: number // 序号 (Serial Number / Primary Key)
  productCategory: string // 产品分类 (Product Category)，例如：成品、半成品
  partNumber: string // 品号 (Part Number / Item Number)
  productName: string // 品名 (Product Name)
  drawingNumber: string // 图号 (Drawing Number)
  flowchartNumber: string // 流程图号 (Process Flowchart Number)
  specifications: string // 规格 (Specifications)
  description: string // 描述 (Description)
  requiredQuantity: number // 所需数量 (Required Quantity)
  unit: string // 单位 (Unit)，例如：M (米), PCS (个)
}

// 产品规格信息表 (Product Specifications Table) API
export const ProductSpecificationsApi = {
  // 查询产品规格信息表 (Product Specifications Table)分页
  getProductSpecificationsPage: async (params: any) => {
    return await request.get({ url: `/server/product-specifications/page`, params })
  },

  // 查询产品规格信息表 (Product Specifications Table)详情
  getProductSpecifications: async (id: number) => {
    return await request.get({ url: `/server/product-specifications/get?id=` + id })
  },

  // 新增产品规格信息表 (Product Specifications Table)
  createProductSpecifications: async (data: ProductSpecificationsVO) => {
    return await request.post({ url: `/server/product-specifications/create`, data })
  },

  // 修改产品规格信息表 (Product Specifications Table)
  updateProductSpecifications: async (data: ProductSpecificationsVO) => {
    return await request.put({ url: `/server/product-specifications/update`, data })
  },

  // 删除产品规格信息表 (Product Specifications Table)
  deleteProductSpecifications: async (id: number) => {
    return await request.delete({ url: `/server/product-specifications/delete?id=` + id })
  },

  // 导出产品规格信息表 (Product Specifications Table) Excel
  exportProductSpecifications: async (params) => {
    return await request.download({ url: `/server/product-specifications/export-excel`, params })
  },
}